package com.hxzy.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hxzy.common.core.domain.entity.Nationality;
import com.hxzy.system.domain.dto.NationalitySearchDTO;
import com.hxzy.system.mapper.NationalityMapper;
import com.hxzy.system.service.NationalityService;
import org.springframework.stereotype.Service;

@Service
public class NationalityServiceImpl extends ServiceImpl<NationalityMapper, Nationality> implements NationalityService {


    @Override
    public IPage<Nationality> selectListAll (NationalitySearchDTO nationalitySearchDTO) {
        IPage<Nationality> of = Page.of(nationalitySearchDTO.getPageNum(), nationalitySearchDTO.getPageSize());
        return this.baseMapper.selectListAll(of, nationalitySearchDTO);
    }

    @Override
    public boolean addNationality (Nationality nationality) {
        int i = this.baseMapper.addNationality(nationality);
        return i > 0;
    }
}
